package com.easysale.services;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.easysale.dao.CategoryDAO;
import com.easysale.domain.Category;

@Service("categoryService")
public class CategoryServiceImpl implements CategoryService {
    private static Logger logger = Logger.getLogger("CategoryService");

    @Autowired
    CategoryDAO categoryDAO;
    
	@Override
	@Transactional
	public void addCategory(Category cat) {
		categoryDAO.addCategory(cat);

	}

	@Override
	@Transactional
	public List<Category> categories() {
		return categoryDAO.categories();
	}

	@Override
	@Transactional
	public void removeCategory(Integer CategoryId) {
		categoryDAO.deleteCategory(CategoryId);
	}

}
